package GroupName.Project_1;


import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.border.EmptyBorder;

import org.jvnet.substance.SubstanceLookAndFeel;
import org.jvnet.substance.border.FlatBorderPainter;
import org.jvnet.substance.border.StandardBorderPainter;
import org.jvnet.substance.button.ClassicButtonShaper;
import org.jvnet.substance.painter.StandardGradientPainter;
import org.jvnet.substance.skin.EmeraldDuskSkin;
import org.jvnet.substance.skin.SubstanceNebulaLookAndFeel;
import org.jvnet.substance.theme.SubstanceTerracottaTheme;
import org.jvnet.substance.theme.SubstanceTintTheme;
import org.jvnet.substance.watermark.SubstanceBubblesWatermark;

import com.jtattoo.plaf.mcwin.McWinLookAndFeel;

import javax.swing.JLabel;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JDialog;

import java.awt.event.ActionListener;
import java.io.File;
import java.io.IOException;
import java.awt.event.ActionEvent;
import java.awt.Color;

public class MainUi1 extends JFrame {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private JPanel contentPane;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					JFrame.setDefaultLookAndFeelDecorated(true); 
					try { UIManager.setLookAndFeel(new McWinLookAndFeel()); } 
					catch (UnsupportedLookAndFeelException e) { // TODO Auto-generated catch block 
						e.printStackTrace(); }		
					 MainUi1 frame = new MainUi1();
					 frame.setVisible(true);
					 frame.setTitle("视频水印系统");
					 
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public MainUi1() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 404, 310);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JPanel panel = new JPanel();
		panel.setBounds(0, 0, 393, 277);
		contentPane.add(panel);
		panel.setLayout(null);
		JButton btnNewButton = new JButton();
		btnNewButton.setContentAreaFilled(false);  //只须加上此句 //此颜色值随便设置，只起占位作用，但是必须加上此句，否则不会出现透明背景效果。
		btnNewButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				EventQueue.invokeLater(new Runnable() {
					public void run() {
						try {
							setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);  
							setVisible(false);
							MainUi2 mu=new MainUi2();
							mu.frame1.setVisible(true);
							} catch (Exception e) {
							e.printStackTrace();
						}
					}
				});
			}
		});
		btnNewButton.setBounds(103, 58, 196, 34);
		panel.add(btnNewButton);
		
		JButton button = new JButton();
		button.setContentAreaFilled(false);  //只须加上此句 //此颜色值随便设置，只起占位作用，但是必须加上此句，否则不会出现透明背景效果。
		
		button.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				new Thread(){  
                    public void run(){  
                   	 Runtime mt =Runtime.getRuntime();
                   	 File  myfile =new File(".\\exe\\ElecardStreamEyeTools","pyuv.exe");
                   	 try {
							mt.exec(myfile.getAbsolutePath());
						} catch (IOException e) {
							// TODO Auto-generated catch block
							e.printStackTrace();
						}
			            }  
			        }.start();	
			}
		});
		button.setBounds(103, 112, 196, 34);
		panel.add(button);
		
		JButton button_1 = new JButton();
		button_1.setBounds(103, 166, 196, 34);
		button_1.setContentAreaFilled(false);  //只须加上此句 //此颜色值随便设置，只起占位作用，但是必须加上此句，否则不会出现透明背景效果。
		
		panel.add(button_1);
		
		JButton button_2 = new JButton();
		button_2.setContentAreaFilled(false);  //只须加上此句 //此颜色值随便设置，只起占位作用，但是必须加上此句，否则不会出现透明背景效果。
		
		button_2.setBounds(103, 221, 196, 34);
		button_2.setOpaque(false);
		panel.add(button_2);
		panel.setOpaque(false);
		JLabel lblNewLabel_1 = new JLabel();
		lblNewLabel_1.setBounds(0, 0, 395, 277);
		panel.add(lblNewLabel_1);
		JPanel panel_1 = new JPanel();
		String path=".\\exe\\Mainui_1.jpg";
		ImageIcon background = new ImageIcon(path);  
		JLabel label = new JLabel(background);  
		label.setBounds(0, 0, label.getWidth(), label.getHeight());
		panel_1.setBounds(0, 0, 395, 365);
		panel_1.add(label);
		panel.add(panel_1);
		setResizable(false);
	}
}
